/*
 * =====================================================================================
 *       Filename:  Fig3_6.cpp
 *
 *    Description:  
 *
 *        Created:  2009年10月17日 15时32分11秒
 *       Revision:  none
 *         Author:  Santal Li (santal), santal.li@gmail.com
 * =====================================================================================
 */
#include <vector>
#include <iostream>

using namespace std;

/**
 * print the target connection object
 * @ const Container & c : container object
 * @ ostream & out = cout : will write the out put to this out stream
 */
template <typename Container>
void printCollection( const Container & c , ostream & out = cout ){

    if ( c.empty() )
        out << "(empty)" ; 

    else{

        typename Container::const_iterator itr = c.begin() ;
        out << "[" << * itr++ ;

        while ( itr != c.end() ){
            out << ", " << *itr++ ;
        }

        out << "]" << endl ;

    }
}




/* int main(){
 *     vector<int> l ; 
 *     l.push_back(10);
 *     l.push_back(20);
 *     l.push_back(30);
 * 
 *     printCollection( l ) ;            
 * }
 */
